<?php
include 'config.inc.php';
$username = @$_GET['username'];
$name_value = @$_GET['name_value'];
include 'member.php';
if($name_value ==''){

	$data = "3";
	$callback = $_GET['callback'];
	echo $callback.'('.json_encode($data).')';exit;
}else{
	if($nickname) {
		$data = "0";
		$callback = $_GET['callback'];
		echo $callback.'('.json_encode($data).')';exit;
	}
  $sql_name = mysql_query("UPDATE wwk_chat_user SET nickname = '{$name_value}' WHERE username = '{$username}'");
}
if(!$sql_name){
	$data = "0";
	$callback = $_GET['callback'];
	echo $callback.'('.json_encode($data).')';
}else{
     //更新聊天记录表的
	  mysql_query("update wwk_chat_msg set nickname='{$name_value}' WHERE username='{$username}'");
  //echo '修改成功：'.$name_value;
	$data = $name_value;
	$callback = $_GET['callback'];
	echo $callback.'('.json_encode($data).')';
}
